#pragma once
#include "Globals.h"

const D3DXCOLOR WHITE		= D3DCOLOR_COLORVALUE(1.0f, 1.0f, 1.0f, 1.0f);
const D3DXCOLOR GREEN		= D3DCOLOR_COLORVALUE(0.0f, 1.0f, 0.0f, 1.0f);
const D3DXCOLOR BLUE		= D3DCOLOR_COLORVALUE(0.0f, 0.0f, 1.0f, 1.0f);
const D3DXCOLOR RED			= D3DCOLOR_COLORVALUE(1.0f, 0.0f, 0.0f, 1.0f);


class Light
{
private:
	D3DLIGHT9				MyLight;	
public:
	void Init(IDirect3DDevice9* Device)
	{
		Device->SetRenderState(D3DRS_SPECULARENABLE, TRUE);

		ZeroMemory(&MyLight, sizeof(D3DLIGHT9));

		MyLight.Type	 = D3DLIGHT_DIRECTIONAL;
		MyLight.Ambient  = 1.0f * WHITE;
		MyLight.Diffuse  = 1.0f * WHITE;	
		MyLight.Specular = 0.5f * WHITE;

		MyLight.Position.x  = -50;	
		MyLight.Position.y  = 50;	
		MyLight.Position.z  = 50;
		MyLight.Direction.x = -1;
		MyLight.Direction.y = -1;
		MyLight.Direction.z = 1;

		MyLight.Range = 200.0f;
		MyLight.Falloff = 40;
		MyLight.Attenuation0 = 1.00f;
		MyLight.Attenuation1 = 0.00f;
		MyLight.Attenuation2 = 0.00f;
		//D3DXVec3Normalize((D3DXVECTOR3*)&MyLight.Direction, (D3DXVECTOR3*)&MyLight.Position);

		Device->SetLight(0, &MyLight);
		Device->LightEnable(0, true);
	}
};



